import React from 'react'
import { Button, Form, Input, Modal } from 'antd';

function Add(props: any) {
  return (
    <div>
      <Modal
        title={props.isadd === true ? props.addtitle : props.edittitle}
        open={props.isModalOpen}
        onOk={props.handleOk}
        onCancel={props.handleCancel}
      >
        <Form
          name="basic"
          labelCol={{ span: 8 }}
          wrapperCol={{ span: 16 }}
          style={{ maxWidth: 600 }}
          initialValues={{ remember: true }}
          onFinish={props.add}
          autoComplete="off"
        >
          <Form.Item label="添加姓名" name="shopName">
            <Input />
          </Form.Item>
          <Form.Item label="添加地址" name="shopAddress">
            <Input />
          </Form.Item>
          <Form.Item label="添加图像" name="shopImage">
            <Input />
          </Form.Item>
          <Form.Item label="添加手机号" name="shopTel">
            <Input />
          </Form.Item>
          <Form.Item label={null}>
            <Button type={props.color} htmlType="submit">
              添加
            </Button>
          </Form.Item>
        </Form>
      </Modal>
    </div>
  )
}

export default Add

